The present invention relates to accessing data sources such as relational databases and non-relational data sources. More particularly, the present invention relates to accessing such data sources utilizing a standard relational database management system interface such as the Open Database Connectivity (ODBC) system.
Conventional relational database management systems allow for data to be accessed based on a physical table definition. The physical table definition provides a physical disk location for the information stored in the database. Such a system may provide satisfactory results in many applications, however, if the database is accessed by different applications, then changes in the database must typically be reflected via changes to the different applications. Thus, a change in the underlying data structure may require changes to each of the applications which access the data merely to retain their existing functions. Furthermore, conventional relational database management systems may be limited in their ability to access non-relational data such as keyed, binary and sequential files.
Efforts to isolate the underlying physical structure of relational databases have included allowing the use of synonyms as logical names for tables and allowing views to contain data from more than one table. However, the use of synonyms may be limiting in the ability to isolate physical data information from end-user applications as knowledge of the underlying physical structure may still be required in that synonyms have typically not been provided for individual column definitions.
One system for isolating physical information about a database from the applications accessing the database is described in commonly assigned U.S. Pat. No. 5,734,887 to Kingberg et al. (the disclosure of which is incorporated herein) which describes a system for logical access of relational databases. However, the Kingberg et al. system may require a separate database driver which provides logical access. Thus, applications which currently utilize standard relational database management systems, such as ODBC, may require modification to be compatible with the system of Kingberg et al. Furthermore, Kingeberg et al. may not provide access to non-relational data sources utilizing logical access.
In light of the above discussion, a need exists for improvements in the access of differing data sources without requiring the applications to have knowledge of the physical structure of the accessed data sources.
In view of the above discussion, it is an object of the present invention to provide data source access without requiring knowledge of the underlying physical structure of the data source.
A further object of the present invention is to provide access to both relational and non-relational data sources utilizing a logical data model.
Still another object of the present invention is to provide logical access to data sources utilizing a standard database management system interface such as the ODBC interface.
Yet another object of the present invention is to allow for modifications in underlying data source structures without requiring revisions to applications which access the data sources.
A further object of the present invention is to provide access to data sources which is backward compatible with applications utilizing existing data source access interfaces.
These and other objects of the present invention may be provided by methods, systems and computer program products which access at least one data source by intercepting a command to a relational database management system and determining if the intercepted command accesses the data source utilizing a logical table name. If the intercepted command accesses the data source utilizing the logical table name, then the logical table name is translated to a physical table name. The intercepted command is then provided to the relational database management system utilizing the physical table name translated from the logical table name so as to provide access the data source utilizing the logical table name.
In a further embodiment of the present invention, if the intercepted command accesses the data source utilizing a logical table name and a logical column name, then the logical table name is translated to the physical table name and the logical column name translated to a physical table name. The intercepted command is then provided to the relational database management system utilizing the physical table name translated from the logical table name and the physical column name translated from the logical column name so as to provide access the data source utilizing the logical table name and the logical column name.
By intercepting commands to a standard relational database management system and then translating logical information in the commands to physical information, access to data sources may be provided without requiring knowledge of the underlying physical structure of the data source, only knowledge of the logical model. By providing access to data sources utilizing a logical model, modifications in underlying data source structures may be made without requiring revisions to applications which access the data sources. Furthermore, by utilizing a standard database management system interface application programmers need not learn a new custom interface but may utilize existing database access drivers to access the data source.
In a still further embodiment of the present invention, it is determined if additional relational database management system commands are required to provide the function of the intercepted relational database management system command utilizing the physical table name and the physical column name. If so, then the additional database management system commands are generated utilizing physical table names and physical column names and the generated commands are provided to the relational database management system utilizing the physical table name and the physical column name so as to provide access the data source utilizing the logical table name and the logical column name. Thus, the present invention provides for instances where the commands which would be generated if the application were aware of the underlying physical structure of the data sources differ from those which are generated based on the logical model of the data sources.
In a particular embodiment of the present invention, the intercepted command is provided to the relational database management system if the intercepted command does not contain a logical table name. Preferably, the relational database management system comprises an Open Database Connectivity (ODBC) system. Furthermore, an ODBC compatible application program may generate the intercepted command. In such an instance, where the intercepted command comprises an ODBC query, the interception of the ODBC query may be performed by exiting the ODBC command processing function subsequent to the ODBC command processing function parsing the ODBC query to determine a type of command associated with the ODBC query.
By utilizing ODBC, the present invention provides logical access to data sources utilizing a standard database management system. Furthermore, the present invention may provide compatibility with existing applications which are aware of the underlying physical structure of the data sources by passing the commands on if logical information is not included in the commands. Thus, the present invention may provide access to data sources which is backward compatible with applications utilizing existing data source access interfaces.
In another embodiment of the present invention, a plurality of data sources are accessed and a plurality of logical column names are associated with the intercepted command. In such a case, a first of the plurality of logical column names may be translated to a first physical column name associated with a first of the plurality of data sources and a second of the plurality of logical column names may be translated to a second physical column name associated with a second of the plurality of data sources. The intercepted command may then be provided to the relational database management system utilizing the first physical column name associated with the first of the plurality of data sources and utilizing the second physical column name associated with the second of the plurality of data sources. Furthermore, at least one of the first and the second of the plurality of data sources may be a relational database and at least one of the first and the second of the plurality of data sources may be a non-relational data source.
In a particular embodiment of the present invention, the translation from logical information to physical information may accomplished by accessing a table of metadata wherein the metadata defines a relationship between the logical table name and the physical table name and mapping the logical table name to the physical table name utilizing the metadata. Preferably, the table of metadata is a relational table.
Furthermore, when the data source is a plurality of data sources a logical model may be defined for accessing data from the plurality of data sources. Metadata may then be generated which describes a relationship between the logical model and data stored in a plurality of data sources. The generated metadata may then be stored as the table of metadata. The relationship between the logical model and the data stored in the plurality of data sources may then be revised by revising the metadata and updating the table of metadata to reflect the revised metadata. Thus, the present invention may provide access to both relational and non-relational data sources utilizing a logical data model.
As will further be appreciated by those of skill in the art, the present invention may be embodied as methods, apparatus/systems and/or computer program products.